chore: automate releases#3833
Conversation
Overhauls the release pipeline into a fully automated, robust, and modular architecture: - Created utils.py, git.py, and gh.py to encapsulate shell executions, git helpers, and GitHub CLI wrappers under clean, prefix-free module namespaces. - Overhauled release.py to use these modules, return clean exit codes, and support dynamic RC tagging and checklist gating. - Overhauled cmd_prepare to make the preparation pipeline fully unconditional (cuts branch, commits, pushes, opens PR, and creates/updates tracking issue). - Integrated news processing directly into cmd_process_backports to merge and amend changelogs per backport. - Created GitHub Actions workflows to automate all release phases (prepare, branch cut, backports, RC tagging, and promotion). - Added comprehensive unit test suites in release_test.py mocking the new module-level namespace helpers.
There was a problem hiding this comment.
Code Review
This pull request introduces a code-centric, reactive release automation architecture for rules_python by splitting the release logic into dedicated helper modules (gh.py, git.py, utils.py) and expanding release.py with several subcommands to handle preparation, branch cutting, backport processing, and release candidate tagging. Feedback on the changes highlights several critical issues, including the need to use git status --porcelain and .splitlines() to properly parse git output line-by-line rather than character-by-character. Additionally, the reviewer noted a Python compatibility issue with Exception.add_note on older Python versions, unsafe dictionary access on PR merge commits, potential failures when staging a non-existent news/ directory, loose regex patterns for parsing versions from issue titles, and potential regex failures due to Windows-style line endings.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
aignas
left a comment
There was a problem hiding this comment.
LGTM other than the versions of the GH actions used in here.
This commit addresses the 12 code review comments on the release automation PR. It fixes the workspace clean checks by using porcelain git status and line splitting, defensively parses PR merge commits, normalizes line endings, compiles a common and simplified issue title version regex, and updates GitHub Action workflow versions to their latest aligned state.
This commit upgrades the actions/checkout version to v7 in the newly added release automation workflow files. It also adds a new project-scoped agent rule configuration under .agents/rules/ to ensure future workflow file creation always adopts the latest action versions.
This introduces workflows and tools to automate releases. The basic
idea it to have an issue with tasks, and workflows invoke tools that
parse and update the tasks in the issue.
The basic release steps are:
Each step has a workflow. For now, most of the workflows require a
manual trigger, to help prevent workflows from running wild as we
flush out bugs and edge cases.
The workflows almost entirely delegate to the
releasetool. There'sbasically one command per workflow. This makes it easy to encode
specialized logic and run it locally for testing or reproduction.